﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using Model;
namespace DAL
{
   public class 商品修改DAL
    {
        //查询商品类型
        public static DataSet ProductType()
        {
            return DBHelper.Duankaishi("select PTID,PTName from ProductType", null);
        }
        //修改商品类型
        public static int ProductsUpdate()
        {
            string sql = "Update Products set ProductName=@ProductName,PTID =@PTID,ProductJP = @ProductJP,ProductPrice = @ProductPrice where ProductID = @ProductID";
            List<SqlParameter> list = new List<SqlParameter>(){
                new SqlParameter("@ProductName",Products.ProductName),
                new SqlParameter("@PTID",Products.PTID),
                new SqlParameter("@ProductJP",Products.ProductJP),
                new SqlParameter("@ProductPrice",Products.ProductPrice),
            new SqlParameter("@ProductID",Products.ProductID)
           };
            return DBHelper.Update(sql, list.ToArray());
        }
    }
}
